package com.atguigu.gmall.service.impl;

import com.atguigu.gmall.entity.SkuSalePropertyValue;
import com.atguigu.gmall.mapper.SkuSalePropertyValueMapper;
import com.atguigu.gmall.service.SkuSalePropertyValueService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SkuSalePropertyValueServiceImpl extends ServiceImpl<SkuSalePropertyValueMapper,SkuSalePropertyValue> implements SkuSalePropertyValueService {
    @Override
    public List<SkuSalePropertyValue> getIsSelecteds(Long productId, Long skuId) {
        QueryWrapper<SkuSalePropertyValue> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("product_id", productId).eq("sku_id", skuId);
        List<SkuSalePropertyValue> skuSalePropertyValues = baseMapper.selectList(queryWrapper);
        return skuSalePropertyValues;
    }
}
